#include <string>
#include <vector>
using namespace std;
string convert(string s, int numRows) {
  int i = 0, n = s.size();
  vector<string> s_list(numRows, "");
  while (i < n) {
    for (int l = 0; l < numRows && i < n; l++) {
      s_list[l] += s[i];
      i++;
    }
    for (int k = numRows - 2; k >= 1 && i < n; k--) {
      s_list[k] += s[i];
      i++;
    }
  }
  string res;
  for (auto &s_t : s_list) {
    res += s_t;
  }
  return res;
}